-- INSERT INTO dbo.t_ReleaseObjects( Parent, Scope)VALUES( 1, 'G')
-- p_UpdReleaseObj "S",123,"admin",0,"JAN","PMO","PMO","PMO","ADMIN","ADMIN","ADMIN","PM","O","PMO","12-12-2010","NA"
-- p_UpdReleaseObj "M",123,"admin",0,"JAN","PMO","PMO","PMO","ADMIN","ADMIN","ADMIN","PM","O","PMO","12-12-2010","NA"
use common
go
IF OBJECT_ID('dbo.p_UpdReleaseObj') IS NOT NULL
BEGIN
    DROP PROCEDURE dbo.p_UpdReleaseObj
    IF OBJECT_ID('dbo.p_UpdReleaseObj') IS NOT NULL
        PRINT '<<< FAILED DROPPING PROCEDURE dbo.p_UpdReleaseObj >>>'
    ELSE
        PRINT '<<< DROPPED PROCEDURE dbo.p_UpdReleaseObj >>>'
END
go
create proc p_UpdReleaseObj
(
	@CuID				int,	-- internal, external
	@ReleaseName			varchar(30)	,
	@objectType			varchar(30),	--  Contact
	@objectName			varchar(500),	--  OrderId
	@DBName				varchar(30),	-- customer long name
	@UserUpdated			varchar(50),	-- Fee Contact: Fixed (R)ate/Flat (F)ee
	@contactPerson			varchar(50)	-- profit share	multiplier
	
) as
begin
	UPDATE t_ReleaseObjects
	SET 
	ReleaseName     = @ReleaseName,
	DBName	        = @DBName,
	ObjName		= @objectName,
	SqlQuery	= @objectName,
	ObjType		=  @objectType,
	UserUpdated	= @UserUpdated,
	ContactPerson	= @contactPerson
	WHERE CuId = @CuID
End

go
EXEC sp_procxmode 'dbo.p_UpdReleaseObj','unchained'
go
IF OBJECT_ID('dbo.p_UpdReleaseObj') IS NOT NULL
    PRINT '<<< CREATED PROCEDURE dbo.p_UpdReleaseObj >>>'
ELSE
    PRINT '<<< FAILED CREATING PROCEDURE dbo.p_UpdReleaseObj >>>'
go
GRANT EXECUTE ON dbo.p_UpdReleaseObj TO public
go